package o;

import android.app.Activity;
import android.content.Context;
import android.os.Build.VERSION;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseDetailResponse.ShareInfo;
import com.huawei.appgallery.foundation.ui.framework.titleframe.bean.BaseTitleBean;
import com.huawei.appgallery.foundation.ui.framework.titleframe.bean.SpinnerItem;
import com.huawei.appmarket.framework.titleframe.title.BackSearchbtnTitle;
import o.ewm.e;
import o.ewm.j;
import o.ewm.n;

public class ejm extends BackSearchbtnTitle {
    private String ˊॱ;
    private String ˋॱ;
    private String ˏॱ;
    private MenuItem ͺ;
    private ImageView ॱˊ;

    public static abstract class c implements djb {
        public abstract void ˋ();

        public void ˊ(SpinnerItem spinnerItem) {
        }

        public void ʼʽ() {
            ˋ();
        }

        public void ˋ(ShareInfo shareInfo) {
        }
    }

    public ejm(Activity activity, BaseTitleBean baseTitleBean, String str) {
        super(activity, baseTitleBean);
        this.ˋॱ = str;
        ˊ(str);
    }

    public View ʽ() {
        View ʽ = super.ʽ();
        Context ˋ = ContentManager.getInstant().getContext();
        this.ˏॱ = ˋ.getString(n.ͺˍ);
        this.ˊॱ = ˋ.getString(n.ˋ);
        if (!(ʽ == null || this.ʻ == null)) {
            this.ॱˊ = (ImageView) this.ʻ.findViewById(j.ॱᶦ);
            this.ॱˊ.setImageResource(e.ˎˎ);
            this.ʻ.setContentDescription(this.ˏॱ);
        }
        return ʽ;
    }

    public MenuItem ˎ(Menu menu) {
        this.ͺ = super.ˎ(menu);
        this.ͺ.setIcon(e.ˎˎ);
        if (VERSION.SDK_INT >= 26) {
            this.ͺ.setContentDescription(this.ˏॱ);
        }
        ˊ(this.ˋॱ);
        return this.ͺ;
    }

    public void ᐝॱ() {
        if ("type_edit".equals(this.ˋॱ)) {
            this.ˋॱ = "type_view";
            if (this.ॱˊ != null) {
                this.ॱˊ.setImageResource(e.ˎˎ);
            }
            if (this.ʻ != null) {
                this.ʻ.setContentDescription(this.ˏॱ);
            }
            if (this.ͺ != null) {
                this.ͺ.setIcon(e.ˎˎ);
                if (VERSION.SDK_INT >= 26) {
                    this.ͺ.setContentDescription(this.ˏॱ);
                    return;
                }
                return;
            }
            return;
        }
        this.ˋॱ = "type_edit";
        if (this.ॱˊ != null) {
            this.ॱˊ.setImageResource(e.ـ);
        }
        if (this.ʻ != null) {
            this.ʻ.setContentDescription(this.ˊॱ);
        }
        if (this.ͺ != null) {
            this.ͺ.setIcon(e.ـ);
            if (VERSION.SDK_INT >= 26) {
                this.ͺ.setContentDescription(this.ˊॱ);
            }
        }
    }

    private void ˊ(String str) {
        if ("type_edit".equals(str)) {
            if (this.ॱˊ != null) {
                this.ॱˊ.setImageResource(e.ـ);
            }
            if (this.ʻ != null) {
                this.ʻ.setContentDescription(this.ˊॱ);
            }
            if (this.ͺ != null) {
                this.ͺ.setIcon(e.ـ);
                if (VERSION.SDK_INT >= 26) {
                    this.ͺ.setContentDescription(this.ˊॱ);
                    return;
                }
                return;
            }
            return;
        }
        if (this.ॱˊ != null) {
            this.ॱˊ.setImageResource(e.ˎˎ);
        }
        if (this.ʻ != null) {
            this.ʻ.setContentDescription(this.ˏॱ);
        }
        if (this.ͺ != null) {
            this.ͺ.setIcon(e.ˎˎ);
            if (VERSION.SDK_INT >= 26) {
                this.ͺ.setContentDescription(this.ˏॱ);
            }
        }
    }

    public String ॱˋ() {
        return this.ˋॱ;
    }
}
